package com.yloveg.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yloveg.dao.SendMailMapper;
import com.yloveg.entity.SendMail;
import com.yloveg.service.SendMailService;

@Service
public class SendMailServiceImpl implements SendMailService {
 
    @Autowired
    private SendMailMapper sendMailMapper;

	@Override
	public PageInfo<SendMail> querySendMailPage(int page, int limit, SendMail record){
	    PageHelper.startPage(page, limit);
	    List<SendMail> listMail = this.sendMailMapper.queryMail(record);
	    PageInfo<SendMail> resultPage = new PageInfo<SendMail>(listMail);
	    return resultPage;
	}

	@Override
	public int insert(SendMail record) {
		record.setCreateDate(new Date());
		record.setState(1);
		return sendMailMapper.insert(record);
	}

	@Override
	public SendMail queryOneSendMail(SendMail record) {
		// TODO Auto-generated method stub
		return sendMailMapper.queryOneSendMail(record);
	}




 
 


}
